home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / include / gck / gckvector.h.z / gckvector.h
Encoding:
C/C++ Source or Header  |  1999-07-21  |  3.3 KB  |  65 lines

  1. /***************************************************************************/
  2. /* GCK - The General Convenience Kit. Generally useful conveniece routines */
  3. /* for GIMP plug-in writers and users of the GDK/GTK libraries.            */
  4. /* Copyright (C) 1996 Tom Bech                                             */
  5. /*                                                                         */
  6. /* This program is free software; you can redistribute it and/or modify    */
  7. /* it under the terms of the GNU General Public License as published by    */
  8. /* the Free Software Foundation; either version 2 of the License, or       */
  9. /* (at your option) any later version.                                     */
  10. /*                                                                         */
  11. /* This program is distributed in the hope that it will be useful,         */
  12. /* but WITHOUT ANY WARRANTY; without even the implied warranty of          */
  13. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           */
  14. /* GNU General Public License for more details.                            */
  15. /*                                                                         */
  16. /* You should have received a copy of the GNU General Public License       */
  17. /* along with this program; if not, write to the Free Software             */
  18. /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,   */
  19. /* USA.                                                                    */
  20. /***************************************************************************/
  21.  
  22. #ifndef __GCKVECTOR_H__
  23. #define __GCKVECTOR_H__
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. /* Two dimensional vector functions */
  30. /* ================================ */
  31.  
  32. double     gck_vector2_inner_product (GckVector2 *a,GckVector2 *b);
  33. GckVector3 gck_vector2_cross_product (GckVector2 *a,GckVector2 *b);
  34. double     gck_vector2_length        (GckVector2 *a);
  35. void       gck_vector2_normalize     (GckVector2 *a);
  36. void       gck_vector2_mul           (GckVector2 *a,double b);
  37. void       gck_vector2_sub           (GckVector2 *c,GckVector2 *a,GckVector2 *b);
  38. void       gck_vector2_set           (GckVector2 *a, double x,double y);
  39. void       gck_vector2_add           (GckVector2 *c,GckVector2 *a,GckVector2 *b);
  40. void       gck_vector2_neg           (GckVector2 *a);
  41. void       gck_vector2_rotate        (GckVector2 *v,double alpha);
  42.  
  43. /* Three dimensional vector functions */
  44. /* ================================== */
  45.  
  46. double     gck_vector3_inner_product (GckVector3 *a,GckVector3 *b);
  47. GckVector3 gck_vector3_cross_product (GckVector3 *a,GckVector3 *b);
  48. double     gck_vector3_length        (GckVector3 *a);
  49. void       gck_vector3_normalize     (GckVector3 *a);
  50. void       gck_vector3_mul           (GckVector3 *a,double b);
  51. void       gck_vector3_sub           (GckVector3 *c,GckVector3 *a,GckVector3 *b);
  52. void       gck_vector3_set           (GckVector3 *a, double x,double y,double z);
  53. void       gck_vector3_add           (GckVector3 *c,GckVector3 *a,GckVector3 *b);
  54. void       gck_vector3_neg           (GckVector3 *a);
  55. void       gck_vector3_rotate        (GckVector3 *v,double alpha,double beta,double gamma);
  56.  
  57. void gck_2d_to_3d(int sx,int sy,int w,int h,int x,int y,GckVector3 *vp,GckVector3 *p);
  58. void gck_3d_to_2d(int sx,int sy,int w,int h,double *x,double *y,GckVector3 *vp,GckVector3 *p);
  59.  
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63.  
  64. #endif
  65.